﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using RipPoll.Library;

namespace RipPoll.Web.Mvc.Models
{
    public class UserModel
    {
        public int Id { get; set; }
        
        [Required]
        [Display(Name = "City")]
        [StringLength(50, ErrorMessage="City length should not exceed 50")]
        public string City { get; set; }

        [Required]
        [Display(Name = "Email")]
        [StringLength(50, ErrorMessage = "Email length should not exceed 50")]
        public string Email { get; set; }

        [Required]
        [Display(Name = "Repeat Email")]
        [Compare("Email",ErrorMessage="EmailIds do not match")]
        public string RepeatEmail { get; set; }

        [Display(Name = "Gender")]
        public List<string> Gender = new List<string>() { "N", "M", "F"};

        [Required]
        public string SelectedGender { get; set; }

        [Required]
        [Display(Name = "Year Of Birth")]
        [Range(1900, 2011, ErrorMessage = "Year of birth must be between {1} and {2}")]
        public Nullable<int> BirthYear { get; set; }

        [Required]
        [Display(Name = "Screen Name or User Name")]
        [StringLength(25, ErrorMessage = "ScreenName length should not exceed 25")]
        public string ScreenName { get; set; }
        
        [Required]
        [DataType( System.ComponentModel.DataAnnotations.DataType.Password)]
        [Display(Name = "Password")]
        [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        public string PassWord { get; set; }

        [Required]
        [Display(Name = "Repeat Password")]
        [DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [Compare("PassWord", ErrorMessage = "Passwords do not match")]
        public string RepeatPassWord { get; set; }

        [Required]
        [Display(Name = "Zip Code")]
        [StringLength(5, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 5)]
        public string ZipCode { get; set; }

        [Required]
        public int SelectedEducationId { get; set; }

        [Display(Name = "Education Background")]
        public List<EducationNamesPE> EducationBackgrounds { get; set; }

        [Required]
        [Display(Name = "SendActivityUpdates")]
        public bool SendActivityUpdates { get; set; }
        
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime DateAdded { get; set; }
        public DateTime DateUpdated { get; set; }
    }
}